local redis = require "redis"

local instance = redis.connect('127.0.0.1',6379)
local msg = instance:ping()

if msg then
	print("Connected")
end

instance:hset("db","type","redis")


print("Input your key:")
local keyStr = io.read()
print("Input your value:")
local valueStr = io.read()
print("You input key ",keyStr,"value",valueStr)
instance:set(keyStr,valueStr)
local response = instance:get(keyStr)
print("-----------------------------")
print(response)

function printtable(table)
	for i,v in pairs(table) do
		print(i,v)
	end
end

--for i,v in pairs(redis) do
	--if type(v)=="table" then
		--printtable(v)
	--else
		--print(i,v)
	--end
--end
